package cn.itsource.service;

import cn.itsource.domain.Article;
import cn.itsource.dto.ArticleDat;
import cn.itsource.dto.ArticleDto;
import cn.itsource.query.Query;
import cn.itsource.util.AjaxResult;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface ArticleService {

    public List<Article> findAll();

    public Article findOne(Long id);

    public void add(Article article);

    public void update(Article article);

    public void delete(Long id);

    //分页+模糊查询
    PageInfo<Article> pageQuery(Query query);

    //批量删除
    void patchdel(Long[] ids);


    //获取文章类型
    List<ArticleDat> articleType();

    List<ArticleDat> timecount();

    //获取相关文章内容
    List<Article> relatedArticles(Long id);

    //根据article_typeid 获取文章数据
    List<Article> articleList(Long articleTypeId);

    //获取按照年份分组
    List<Article> yearGrougBy();

    List<Article> getNameandReadCount();

    //扇形
    List<ArticleDat> sector();

    List<ArticleDto> getBlogGdList();


    /**
     * 前台系统点赞功能接口
     * @param id
     * @param request
     * @return
     */
    AjaxResult updateStar(Long id, HttpServletRequest request);

    /**
     * 业务接口：前台点赞图片样式加载
     * @param id
     * @param request
     * @return
     */
    AjaxResult initIconClass(Long id, HttpServletRequest request);


}
